﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp7
{
    class Program
    {
        static void Main(string[] args)
        {

            //猫、狗、鸭、猴，（吃、游泳、爬树）
            Cat a = new Cat();
            Cat(a);
            Console.WriteLine("---------------------");
            Dog dog = new Dog();
            Dog(dog);
            Console.WriteLine("---------------------");
            Monkey monkey = new Monkey();
            Monkey(monkey);
            Console.WriteLine("---------------------");
            Duck duck = new Duck();
            Duck(duck);
        }
        public static void Cat(Cat a) 
        {
            a.cat();
            a.Eat();
            ITree tree = a;
            tree.Tree();
        }
        public static void Dog(Dog dog)
        {
            dog.dog();
            dog.Eat();
            ISwim swim = dog;
            swim.Swim();

            
        }
        public static void Monkey(Monkey a)
        {
            a.cat();
            a.Eat();
            ITree tree = a;
            tree.Tree();
        }
        public static void Duck(Duck duck)
        {
            duck.duck();
            duck.Eat();
            ISwim swim = duck;
            swim.Swim();


        }
    }
}
